<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>AJAX获得数据</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
    </script>
    <script>
        $(document).ready(function(){
            $.get("blogListPage", { },
                function(data){

                let blogList =   data.objList;
                    let tabStr = "";
                    $.each( blogList, function(i, item){
                        tabStr += "<tr>"
                        tabStr +="<td>"+item.id+"</td>"
                        tabStr +="<td>"+item.content+"</td>"
                        tabStr +="<td>"+item.publishtime+"</td>"
                        tabStr +="<td>"+item.userid+"</td>"
                        tabStr += "</tr>"
                    });
                    $("#blogTab").html(tabStr);

                    let pageInfo = "总记录数："+data.count;
                    pageInfo += "总页数："+data.totalPage;
                    pageInfo += "当前页数："+data.current;
                    pageInfo += "每页记录数数："+data.pageSize;
                    debugger;
                    $("#pageInfo").html(pageInfo);

                });

        });
    </script>
</head>
<body>
ajax test
<div>
    <table>
        <tr>
            <th>id</th>
            <th>内容</th>
            <th>时间</th>
            <th>用户</th>
        </tr>
        <tbody id="blogTab">

        </tbody>
    </table>
    <div id="pageInfo">

    </div>
</div>
</body>
</html>